package leetcode

/*
 * @lc app=leetcode.cn id=1232 lang=golang
 *
 * [1232] 缀点成线
 */

// @lc code=start
func checkStraightLine(coordinates [][]int) bool {
	x1, y1, x2, y2 := coordinates[0][0], coordinates[0][1], coordinates[1][0], coordinates[1][1]
	for _, v := range coordinates[2:] {
		x, y := v[0], v[1]
		if (y2-y1)*(x-x1) != (y-y1)*(x2-x1) {
			return false
		}
	}
	return true
}

// @lc code=end
